<extend name="Yg/index" />
<block name="main">
            <div class="col-lg-12 container-fluid">
                    <h2 class="page-header">
                            个人中心
                    </h2>
                    <ol class="breadcrumb">
                        <li class="active">
                            <i class="fa fa-dashboard"></i> 您的位置 => 个人密码修改
                        </li>
                    </ol>
        </div>
    <div  class="col-md-12">  
		<div class="col-md-8">
			<form action="<{:U('Gr/mpass')}>" method='post' class="form-horizontal">
			<table >
						<input type="hidden"  name="id" class="form-control" value="<{$vo.id}>">
						<input type="hidden"  name="uid" class="form-control" value="<{$vo.uid}>" id="userid">
				<tr>
				<td height="10" width="130"><h4>输入旧密码:</h4 ></td>
					<td height="10" width="200">
					
					<input  type="text" name="m1" class="form-control input-lg" value="" id="m1" >

							
					</td>
					<td id="mima1" height="10" width="200">
						
					</td>	
				
				</tr>
				<tr height='15'>
					<td></td>
				</tr>
				<tr >
					<td height="10" width="130"><h4>输入新密码：</h4></td>
					<td height="10" width="200">
					<input  type="text" name="password" class="form-control input-lg" value="" disabled id="mima2">
					</td>
					<td>
						
					</td>
				</tr>
				<tr height='15'>
					<td></td>
				</tr>
				<tr>
					<td height="10" width="130"><h4>请再次确认：</h4></td>
					<td height="10" width="200">
					<input  type="text" name="m2" class="form-control input-lg" value="" disabled id="mima3">
					</td>
					<td id="mima4" height="10" width="200">
						
					</td>
					
				</tr>
				<tr height='15'>
					<td></td>
				</tr>
				<tr>
					<td></td>
					<td >
					<button type="submit" class="btn btn-default btn-lg" disabled id='tj'> 修 改 </button>
						
					</td>
				</tr>
			</table>
			</form>
		</div>


	</div> 
	<script>
		$(document).ready(function(){

			$('#m1').blur(function(){
				 var oldpass=$("#m1").val();
				 var id=$('#userid').val();
			$.ajax({
				type:"POST",
                url:"<{:U('Gr/doAjax')}>",
                dateType:'json',
                data: {"oldpass":oldpass,"userid":id},
				success:function (info){
					$('#mima1').html(info);
					if (info=='密码正确!') {
					$('#mima2').attr('disabled',false);
					$('#mima3').attr('disabled',false);
					}
				}
			})

			})

			$("#mima3").change(function(){
				var m2=$('#mima2').val();
				var m3=$('#mima3').val();
				if(m2==m3){
					$('#mima4').html('两次密码一致!请提交!');
					$('#tj').attr('disabled',false)
				}else{
					$('#mima4').html('两次密码不一致!请检查您的输入!');
				}	
			});
		})
	</script>	
		
</block>